<%-- 
    Document   : department
    Created on : Apr 28, 2013, 7:11:47 PM
    Author     : wan.fairul
--%>
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: Admin : Observation Task :.</title>    
        <script type="text/javascript">
            $(function() {
                $("#dialog-form").dialog({
                    autoOpen: false,
                    height: 500,
                    width: 600,
                    modal: true,
                    buttons: {
                        "Save": function() {
                            var frm = document.forms.popupForm;
                            frm.action = frm.action + '?saveEditStatus';
                            frm.submit();
                        },
                        Cancel: function() {
                            $(this).dialog("close");
                        }
                    },
                    close: function() {
                    }
                });

            });


            function unblockUI() {
                $.unblockUI();
            }

            function blockUI() {
                $.blockUI();
            }

            function editTask(observationTaskId) {
                var url = '${pageContext.request.contextPath}/adminObs?popupEditStatus&observationTaskId=' + observationTaskId;
                $.get(url, function(data) {
                    $('#dialog-form').html(data);
                });
                $("#dialog-form").dialog("open");
            }


            function isNumberKey(evt)
            {
                var charCode = (evt.which) ? evt.which : event.keyCode
                if (charCode > 31 && (charCode < 45 || charCode > 57 || charCode == 47))
                    return false;

                return true;
            }

        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/>
        <s:form beanclass="exatrez.stripes.action.ObservationAdminAction" name="form1">           
            <div>

                <div id="page-title">
                    <span class="title">Observation Task Status</span>
                </div>
                <display:table class="tablecloth" name="${actionBean.observation.taskList}" requestURI="/observation?searchDraftReport" id="line">
                    <display:column title="Obs. ID" ><center>${line.observationTaskId}</center></display:column>
                        <display:column title="Title" property="title"/>       
                        <display:column title="Severity" property="severity.severityName"/>
                        <display:column title="Day Count" property="severityDayCount"/>                               
                        <display:column title="Remarks" property="statusRemarks.statusRemarkName"/>
                        <display:column title="Action">
                        <center>
                            <a href="#" 
                               onclick="editTask('${line.observationTaskId}');
                return false;">
                                <img src="${pageContext.request.contextPath}/images/icon/edit.png" alt="edit"/>
                            </a>
                        </center>
                    </display:column>
                </display:table>
            </s:form>
            <div id="dialog-form" title="Edit Observation Task Status">
            </div>
    </body>
</html>
